1 using UnityEngine;
2
3 namespace
ExitGames.Client.GUI
4 {
5     
public enum GizmoType
6     {
7         WireSphere,
8         Sphere,
9         WireCube,
10         Cube,
11     }
12
13     
public class GizmoTypeDrawer
14     {
15         
public static void Draw( Vector3 center, GizmoType type, Color color, float size )
16         {
17             Gizmos.color = color;
18
19             
switch( type )
20             {
21             
case GizmoType.Cube:
22                 Gizmos.DrawCube( center, Vector3.one * size );
23                 
break;
24             
case GizmoType.Sphere:
25                 Gizmos.DrawSphere( center, size *
0.5f );
26                 
break;
27             
case GizmoType.WireCube:
28                 Gizmos.DrawWireCube( center, Vector3.one * size );
29                 
break;
30             
case GizmoType.WireSphere:
31                 Gizmos.DrawWireSphere( center, size *
0.5f );
32                 
break;
33             }
34         }
35     }
36 }



Trò chơi Tic-Tac-Toe, game đánh caro full source code 53.526 lượt xem

Gõ tìm kiếm nhanh...